package day15;

import java.util.Arrays;
import java.util.Comparator;

public class Algorithm05 {                                //Arrays.sort()
    public static void main(String[] args) {
        Integer[] arr = {6,1,2,5,4,3,9,7,10,8};
        Arrays.sort(arr,new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1 - o2;
            }
        });
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        Arrays.sort(arr,(o1,o2)->o2-o1);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
